<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <meta name="referrer" content="no-referrer" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <!-- layui -->
    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">
    <title>美食分享平台</title>
    <style>
        body {
            margin: 0;
            padding: 0;
        }
        #myCarousel {
            margin: auto;
            width: 100%;
        }
        #top{
            margin: auto;
        }
        #user_head{
            position: absolute;
            width: 100%;
            top: 10px;
            right: 10px;
            margin: auto;
        }
    </style>
</head>
<body>
<div th:replace="common/m_topbar::m_topbar"></div>
<div class="container" style="margin-top: 40px">
        <form action="/foodshare/main/saveUser" method="post">
            <input type="hidden" name="userId" th:value="${user.userId}">
            <input type="hidden" name="role" th:value="${user.role}">
            <input type="hidden" name="head" class="image">
            <div style="text-align: center">
                <img data-anim="layui-anim-scaleSpring" class="layui-upload layui-anim" id="upload_img"
                     style="border-radius: 50%; width: 100px;height: 100px"
                th:src="${user.head}">
                <div class="layui-word-aux">点击更换我的头像</div>
                <p id="demonText"></p>
                <br/>
            </div>
            <div class="form-row">
                <br/>
                <div class="form-group col-md-6">
                    <label>用户名</label>
                    <input type="text" class="form-control" name="username" th:value="${user.username}">
                </div>
                <div class="form-group col-md-6">
                    <label>密码</label>
                    <input type="password" class="form-control" name="password" th:value="${user.password}">
                </div>
            </div>
            <div class="form-row">
                <div class="form-group col-md-6">
                    <label>性别</label>
                    <select name="sex" class="form-control">
                        <option th:selected="${user.sex eq '男'}">男</option>
                        <option th:selected="${user.sex eq '女'} ">女</option>
                    </select>
                </div>
                <div class="form-group col-md-6">
                    <label>邮箱号</label>
                    <input type="email" class="form-control" name="email" placeholder="name@example.com" th:value="${user.email}">
                </div>
            </div>
            <div class="form-row">
                <div class="form-group col-md-6">
                    <label>手机号码</label>
                    <input type="text" class="form-control" name="phone" th:value="${user.phone}">
                </div>
                <div class="form-group col-md-4">
                    <label>安全问题</label>
                    <select name="question" class="form-control" th:value="${user.question}">
                        <option>你的出生地在哪？</option>
                        <option>你印象最深的动漫名字？</option>
                        <option>你最熟悉的名字？</option>
                        <option>你最喜欢的水果？</option>
                    </select>
                </div>
                <div class="form-group col-md-2">
                    <label>安全答案</label>
                    <input type="text" class="form-control" name="answer" th:value="${user.answer}">
                </div>
            </div>
            <div class="col-sm-12">
                <br/>
                <button type="submit" class="btn btn-primary">修改</button>
            </div>
        </form>
</div>
<!-- 底部 -->
<div style="margin-top: 50px">
    <div th:replace="common/m_bottom::m_bottom"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script th:src="@{/asserts/js/layui.js}"></script>
</body>
</html>